package com.zhkj.txg.module.home.entity

import com.chad.library.adapter.base.entity.node.BaseNode
import com.google.gson.annotations.SerializedName
import com.zhkj.lib.http.BaseResponse
import com.zhkj.txg.module.mine.entity.CouponEntity

data class HomeResponse(
    val data: HomeEntity
) : BaseResponse()

data class HomeEntity(
    val banner: MutableList<BannerEntity> = mutableListOf(),
    val navigation: MutableList<NavigationEntity> = mutableListOf(),
    val activity: ActivityEntity? = null,
    val cube: MutableList<Cube> = mutableListOf(),
    val goods: Goods? = null,
    val notify: MutableList<Notify> = mutableListOf(),
    val ad: AdEntity? = null,
    val grass: MutableList<GrassEntity> = mutableListOf(),
    val sell: MutableList<SellEntity> = mutableListOf(),
    val nextSell: MutableList<SellEntity> = mutableListOf(),
    val coupon: CouponEntity? = null,
    var group_image: String? = null,
    var spike_image: String? = null,
    // 自定义属性，需要显示的Model
    var sellData: SellDataEntity? = null
)

data class BannerEntity(
    val title: String = "",
    val image: String = "",
    @SerializedName("jump_type")
    var jumpType: Int? = 0,
    var params: String? = null
)

data class Cube(
    val title: String,
    val image: String,
    val jump_type: Int,
    val params: String
)

data class Notify(
    val title: String,
    val content: String,
    val create_time_text: String
)

data class NavigationEntity(
    val id: Int,
    @SerializedName("title")
    val name: String = "",
    val image: String = "",
    @SerializedName("cat_id")
    val catId: Int,
    @SerializedName("jump_type")
    val jumpType: Int? = 0,
    val params: String? = null
) {
    var selected: Boolean = false
}

data class ActivityEntity(
    val title: String = "",
    val image: String = "",
    val jump_type: Int,
    val params: String? = null
)

data class Goods(
    val recommend: MutableList<RecommendInfo> = mutableListOf(),
    val promotion: MutableList<PromotionInfo> = mutableListOf(),
    val goods: MutableList<SearchProductEntity> = mutableListOf()
)

data class AdEntity(
    val title: String = "",
    val image: String = "",
    val href: String = ""
)

data class GrassEntity(
    val id: Int,
    val content: String = "",
    val images: String = ""
)

data class SellEntity(
    val id: Int,
    @SerializedName("goods_name")
    val goodName: String = "",
    val image: String = "",
    val price: String = "",
    @SerializedName("market_price")
    val marketPrice: String = "",
    @SerializedName("is_new")
    val isNew: String? = null,
    @SerializedName("share_earn")
    val shareEarn: String = "",
    @SerializedName("sales_sum")
    val salesSum: Int = 0,
    @SerializedName("store_count")
    val storeCount: Int = 0,
    override val childNode: MutableList<BaseNode>? = null
) : BaseNode()

data class HotGoodInfo(
    var shop_id: String = "",
    val shop_count: String = "",
    val id: String = "",
    val goods_name: String = "",
    val image: String = "",
    val price: String = "",
    override val childNode: MutableList<BaseNode>? = null
) : BaseNode()

data class PromotionInfo(
    val shop_count: String = "",
    val id: String = "",
    val goods_name: String = "",
    val image: String = "",
    val price: String = "",
    @SerializedName("active_price")
    val activePrice: String = "",
    @SerializedName("discount")
    val discount: String = "",
    override val childNode: MutableList<BaseNode>? = null
) : BaseNode()

data class RecommendInfo(
    val shop_count: String = "",
    val id: String = "",
    val goods_name: String = "",
    val image: String = "",
    val price: String = "",
    override val childNode: MutableList<BaseNode>? = null
) : BaseNode()

class SellDataEntity : BaseNode() {
    override val childNode: MutableList<BaseNode> = mutableListOf()
}

class HotGoodsHeaderEntity : BaseNode() {
    override val childNode: MutableList<BaseNode>? = null
}